package top.kaoshanji.r2ch07d;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 代码清单-r2ch07d-03：验证一下异常增强
 * @author kaoshanji
 * ^_^
 * create time 2025/5/7 17:09
 */
public class TransactionManagerThrowsAdviceContext {

    public static void main(String[] args) throws Exception {

        ApplicationContext context = new ClassPathXmlApplicationContext("r2ch07d/transaction-manager-throws-advice-beans.xml");
        ForumService forumService = (ForumService) context.getBean("forumService");

        try{
            forumService.removeForum(10);
        } catch (Exception e) {}

        try{
            forumService.updateForum(new Forum());
        } catch (Exception e) {}

    }

}
